home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / Interrupts.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-15  |  2.9 KB  |  112 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Interrupts.h
  3.  
  4.      Contains:    Interface to the Interrupt Manager.
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2.
  7.                  Package:    Universal Interfaces 2.1.2 on ETO #20
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __INTERRUPTS__
  21. #define __INTERRUPTS__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41. typedef KernelID InterruptSetID;
  42.  
  43. typedef long InterruptMemberNumber;
  44.  
  45. struct InterruptSetMember {
  46.     InterruptSetID                    setID;
  47.     InterruptMemberNumber            member;
  48. };
  49. typedef struct InterruptSetMember InterruptSetMember;
  50.  
  51.  
  52. enum {
  53.     kISTChipInterruptSource        = 0,
  54.     kISTOutputDMAInterruptSource = 1,
  55.     kISTInputDMAInterruptSource    = 2,
  56.     kISTPropertyMemberCount        = 3
  57. };
  58.  
  59. typedef InterruptSetMember ISTProperty[kISTPropertyMemberCount];
  60.  
  61. #define kISTPropertyName    "driver-ist" 
  62.  
  63. typedef long InterruptReturnValue;
  64.  
  65.  
  66. enum {
  67.     kFirstMemberNumber            = 1,
  68.     kIsrIsComplete                = 0,
  69.     kIsrIsNotComplete            = -1,
  70.     kMemberNumberParent            = -2
  71. };
  72.  
  73. typedef Boolean InterruptSourceState;
  74.  
  75.  
  76. enum {
  77.     kSourceWasEnabled            = true,
  78.     kSourceWasDisabled            = false
  79. };
  80.  
  81. typedef InterruptMemberNumber (*InterruptHandler)(InterruptSetMember ISTmember, void *refCon, UInt32 theIntCount);
  82. typedef void (*InterruptEnabler)(InterruptSetMember ISTmember, void *refCon);
  83. typedef InterruptSourceState (*InterruptDisabler)(InterruptSetMember ISTmember, void *refCon);
  84.  
  85. enum {
  86.     kReturnToParentWhenComplete    = 0x00000001,
  87.     kReturnToParentWhenNotComplete = 0x00000002
  88. };
  89.  
  90. typedef OptionBits InterruptSetOptions;
  91.  
  92. /*  Interrupt Services  */
  93. extern OSStatus CreateInterruptSet(InterruptSetID parentSet, InterruptMemberNumber parentMember, InterruptMemberNumber setSize, InterruptSetID *setID, InterruptSetOptions options);
  94. extern OSStatus InstallInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void *refCon, InterruptHandler handlerFunction, InterruptEnabler enableFunction, InterruptDisabler disableFunction);
  95. extern OSStatus GetInterruptFunctions(InterruptSetID setID, InterruptMemberNumber member, void **refCon, InterruptHandler *handlerFunction, InterruptEnabler *enableFunction, InterruptDisabler *disableFunction);
  96. extern OSStatus ChangeInterruptSetOptions(InterruptSetID setID, InterruptSetOptions options);
  97. extern OSStatus GetInterruptSetOptions(InterruptSetID setID, InterruptSetOptions *options);
  98.  
  99. #if PRAGMA_IMPORT_SUPPORTED
  100. #pragma import off
  101. #endif
  102.  
  103. #if PRAGMA_ALIGN_SUPPORTED
  104. #pragma options align=reset
  105. #endif
  106.  
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110.  
  111. #endif /* __INTERRUPTS__ */
  112.